﻿using Gp.Scripts.Core;
using Gp.Scripts.Data;
using QFramework;
using UnityEngine;
using IAction = GameCreator.Core.IAction;

namespace Gp.GCX {
    [AddComponentMenu("")]
    public class TryPuzzleAc : IAction {
        public BasePuzzle puzzle;
        
 
        // public string characterName;

        public override bool InstantExecute(GameObject target, IAction[] actions, int index) {
            puzzle.TryPuzzle();
            return true;
        }


#if UNITY_EDITOR
        public new static string NAME = "Gp/其他/测试解谜";
        private const string NODE_TITLE = "测试解谜 {0}";

        public override string GetNodeTitle()
        {
            string name = puzzle == null ? "无": puzzle.puzzleName;
            return string.Format(NODE_TITLE, name);
        }

#endif
    }
}